<?php
namespace app\admin\controller;

use app\admin\controller\Common;
use think\Controller;
use think\Config;
class Reward extends Common
{
	public function index()
	{
		return $this->fetch();
	}

	public function edit()
	{
		
	$config=include APP_PATH."/config.php" ;
	
	$config=array_merge($config,array_change_key_case(input(),CASE_UPPER));
	$str="<?php return " .var_export($config,true).";\r\n?>";
	

	if(file_put_contents(APP_PATH."/config.php", $str))
	{
		$this->success('修改成功',$_SERVER['HTTP_REFERER']);
	}else
	{
		$this->error('修改失败');
	}
	}

	//经验级别规则设置视图
	public function level(){
		return $this->fetch();
	}
}